Skip to main content

Zero, One and Few Shot Prompting

·3 mins

Prompting in ChatGPT and GPT-3 #

Prompting in ChatGPT and GPT-3 can be done in various ways, such as zero-shot, one-shot, and few-shot prompting. Each method offers different advantages and can be very useful in certain situations.

Zero-Shot Prompting πŸ’‘ #

Zero-shot prompting is when the model is given no examples of the expected result in order to guess the best result. When applied to an image description example, GPT-3 will generate a result that is usually good, but not perfect.

Prompt #

Write an image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok

Result #

Zero shot result
A towering, muscular Muay Thai fighter stands center stage in a bustling stadium in Bangkok. He is adorned in gleaming, traditional red and gold shorts and a white tank top, highlighting his impressive physique. The crowd roars in excitement as he prepares to engage in a fierce, action-packed battle of skill and endurance. The fighter exudes confidence and determination, his eyes focused on his opponent and his fists clenched in readiness. The electrifying atmosphere of the stadium adds to the drama, as fans eagerly await the thrilling exchange of blows

One-Shot Prompting 🎯 #

One-shot prompting is when the model is given one example of the result you want. In the image description example, when given only one example, the result was much more accurate and compressed.

Prompt #

Write a compressed image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok:

muscular Muay Thai fighter, red and gold shorts, white tank top, the crowd roars, stadium, Bangkok --ar 16:9

Write a compressed image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok:

Result #

Muay Thai fighter, muscular, clad in red/gold shorts, white top, amid cheering crowd, Bangkok stadium
Muay Thai fighter, muscular, clad in red/gold shorts, white top, amid cheering crowd, Bangkok stadium

Few-Shot Prompting πŸ”₯ #

Few-shot prompting is when the model is given a small number of examples of the desired results. When applied to the image description example, it was able to generate a result that was as expected with the desired aspect ratio at the end. πŸ˜ƒ

Prompt #

Write a compressed image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok:

muscular Muay Thai fighter, red and gold shorts, white tank top, the crowd roars, stadium, Bangkok --ar 16:9

Write a compressed image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok:

Muscular Muay Thai fighter, dominates stadium, Bangkok, intense focus, grace and power, striking fierce kicks and punches, amidst energetic spectators --ar 16:9

Write a compressed image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok:

Powerful, Muay Thai fighter, stands poised in Bangkok stadium, muscles tense, focus intense, Crowd roars, energy palpable. Traditional dress, grace and precision embodied in every strike. A true warrior in the ring --ar 16:9

Write a compressed image description with adjectives and nouns of Muay Thai Fighter in a Stadium in Bangkok:

Result #

Dynamic Muay Thai fighter, Bangkok stadium, red-gold shorts, white tank, exudes strength and skill, executing lightning-fast strikes, surrounded by enthusiastic fans, showcasing ancient martial art –-ar 16:9
Dynamic Muay Thai fighter, Bangkok stadium, red-gold shorts, white tank, exudes strength and skill, executing lightning-fast strikes, surrounded by enthusiastic fans, showcasing ancient martial art –ar 16:9

This blog is a summary of the contents in this Youtube video: